<?php

namespace App\Http\Resources\Admin;

use Illuminate\Http\Resources\Json\Resource;

class Withdraw extends Resource
{
    /**
     * Transform the resource collection into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'invoice' => $this->invoice,
            'amount' => $this->amount,
            'remark' => $this->remark,
            'bank_card_number' => $this->bank_card_number,
            'status' => $this->status,
            'status_label' => $this->status_label,
            'shop' => $this->whenLoaded('shop'),
            'created_at' => $this->created_at->format('Y-m-d H:m:s'),
            'updated_at' => $this->updated_at->format('Y-m-d H:m:s')
        ];
    }
}